package com.situ.mall.common.mapper;

import com.situ.mall.common.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.mall.common.vo.OrderVO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-01-29
 */
public interface OrderMapper extends BaseMapper<Order> {

    /* 后端请求 */
    //查询订单
    List<OrderVO> list(String memberName, String workerName);

    //更新订单状态
    @Update("update orders set status = #{status} where id = #{id}")
    void update(Order order);


    /* 前端请求 */
    //查询用户订单
    @Select("select * from orders where member_id = #{id}")
    List<Order> userOrders(Integer id);
}
